package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class AskQuery extends QueryObject {
    public static final Integer ASK_COMMENTNUM_DESC = 1;//评论降序
    public static final Integer ASK_NOWTIME_DESC = 2;//时间降序
    public static final Integer ASK_NOWTIME_BY_0 = 3;//时间降序与未评论的问题

    private String status = "1";
    private Integer type = 1;


    public String getTypeOrber(){
        String order = "";
        if (type == ASK_COMMENTNUM_DESC) {
            order = "(a.commentnum + a.topnum) desc";
        }else if(type == ASK_NOWTIME_DESC){
            order = "a.nowtime desc";
        }else if(type == ASK_NOWTIME_BY_0){
            order = "a.nowtime desc";
        }
        return order;
    }
}
